#include<stdio.h>

int main()
{
    int a=0;
    int b=0;
    int ret=0;
    scanf("%d %d",&a,&b);
    int day[]={0,31,29,31,30,31,30,31,31,30,31,30,31};
    for(int i=1;i<=12;i++)//打印月份
    {
        for(int j=1;j<=day[i];j++)//天
        {
            int tem=j%10*1000+j/10*100+i%10*10+i/10;
            int year=tem*10000+i*100+j;
            if(year>=a&&year<=b)  
            {
                ret++;
            }
        }
    }
    printf("%d",ret);
}